#include <regx52.h>
#include "oled.h"
#include "Timer1.h"

unsigned char flag = 0;

// 外部中断中断处理函数 P33
void External_Interrupt_1(void) interrupt 2 {
    flag = 1;
}


int main()
{
	OLED_Init();
    OLED_ShowString(1,1,"HC-SR501:");
    External_Interrupt1_Init();
    while (1)
    {
        if(flag)
        {
            OLED_ShowString(2,1,"WAR:Someone");
        }else{
            OLED_ShowString(2,1,"               ");
        }
    }
}

